#!/usr/bin/python

import WykopAPI
import SimpleRequest
import WykopRespLink

class WykopPopular(SimpleRequest.SimpleRequest):
    
    H_WykopAPI = None
    
    def _sng_query(self, type):
        self._addElement('popular')
        self._addElement(type)
        self._addAPIElement(self.H_WykopAPI._appkey, self.H_WykopAPI._userkey)
        self._send()
        C = WykopRespLink.WykopRespLink()
        return C._normalizeData(self._getData())
    
    
    def __init__(self, WykopAPIHandler):
        
        self.H_WykopAPI =  WykopAPIHandler
        
        
    def getPromoted(self):
        
        return self._sng_query('promoted')
    
    def getUpcomming(self):
        
        return self._sng_query('upcomming')        